package com.zh.note.huawei.onehundred.日志采集系统;

/**
 * @Author: zhanghuan
 * @date: 2023/8/4 20:15
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        // Scanner sc = new Scanner(System.in);
        // String inputValue = sc.nextLine();
        String inputValue = "1 98 1";
        // String inputValue = "50 60 1";

        int scoreResult = 0;
        String[] split = inputValue.split(" ");
        int[] intNumbers = new int[split.length];
        for (int i = 0; i < intNumbers.length; i++) {
            intNumbers[i] = Integer.parseInt(split[i]);
        }
        if (intNumbers.length > 0 && intNumbers[0] > 100) {
            System.out.println(100);
            return;
        }
        for (int i = 0; i < intNumbers.length; i++) {
            scoreResult = Math.max(scoreResult, getScore(intNumbers, i));
        }

        System.out.println(scoreResult);

    }

    private static int getScore(int[] numbers, int ts) {
        int myScore = 0; // 总积分
        int sum = 0; //当前积分
        for (int i = 0; i <= ts; i++) {
            if (sum + numbers[i] < 100) {
                myScore += numbers[i]; //计算当前的得分
                myScore -= numbers[i] * (ts - i); //计算扣除的积分
                sum += numbers[i];
            } else {
                // 当前的得分大于100
                int dis = 100 - sum; // 用来计算要拆分后的剩余积分
                // for (int j = 0; j < i; j++) {
                //     dis -= numbers[j];
                //     // numbers[j] = 0;
                // }
                // numbers[i] -= dis;
                myScore += dis;
                myScore -= dis * (ts - i);
                return myScore;
            }
        }
        return myScore;

    }
}
